Boolean Data Type
In programming languages, we have various data types to store different types of data. Some of the most used data types are integer, string, float, and boolean. The boolean data type is a type of data that stores only two types of values i.e. True or False. These values are not case-sensitive depending upon programming languages. The name Boolean comes from the branch of mathematics called Boolean algebra, named after George Bool the mathematician....
read more
Return True if Cast Between Data Types can Occur According to the Casting rule in Python
In this article, we will see that if the program returns True if the case between different data types can occur according to the casting rule of Python....
read more
Self Type in Python
Self-type is a brand-new function added to Python 3.11. A method or function that returns an instance of the class it belongs to is defined by the self type. In situations where we wish to enforce that a method returns an instance of the class and not some other type, self-type is beneficial....
read more
User Defined Data Structures in Python
In computer science, a data structure is a logical way of organizing data in computer memory so that it can be used effectively. A data structure allows data to be added, removed, stored and maintained in a structured manner. Python supports two types of data structures:...
read more
Type Casting in Python (Implicit and Explicit) with Examples
Type Casting is the method to convert the Python variable datatype into a certain data type in order to perform the required operation by users. In this article, we will see the various techniques for typecasting. There can be two types of Type Casting in Python:...
read more
Python Numbers
In Python, “Numbers” is a category that encompasses different types of numeric data. Python supports various types of numbers, including integers, floating-point numbers, and complex numbers. Here’s a brief overview of each:...
read more
Truthy vs Falsy Values in Python
In this article, we will see about the concept of Truthy and Falsy values in Python and also see how to determine a value is Truthy or Falsy by using bool() built-in Python function....
read more
How To Convert Data Types in Python 3?
Prerequisites: Python Data Types...
read more
Python del to delete objects
The del keyword in Python is primarily used to delete objects in Python. Since everything in Python represents an object in one way or another, The del keyword can also be used to delete a list, slice a list, delete dictionaries, remove key-value pairs from a dictionary, delete variables, etc....
read more
Convert integer to string in Python
In Python an integer can be converted into a string using the built-in str() function. The str() function takes in any python data type and converts it into a string. But use of the str() is not the only way to do so. This type of conversion can also be done using the “%s” keyword, the .format function or using f-string function....
read more
Type Hints in Python
Python is a dynamically typed language, which means you never have to explicitly indicate what kind of variable it is. But in some cases, dynamic typing can lead to some bugs that are very difficult to debug, and in those cases, Type Hints or Static Typing can be convenient. Type Hints have been introduced as a new feature in Python 3.5....
read more
Python | Float type and its methods
The float type in Python represents the floating point number. Float is used to represent real numbers and is written with a decimal point dividing the integer and fractional parts. For example, 97.98, 32.3+e18, -32.54e100 all are floating point numbers....
read more